//
//  B_AboutUsVC.m
//  DreamOf
//
//  Created by 薛小刚 on 2018/8/19.
//  Copyright © 2018年 薛小刚. All rights reserved.
//

#import "B_AboutUsVC.h"
#import "B_AboutUsHeaderView.h"
#import "B_AboutUsTVC.h"

@interface B_AboutUsVC ()

@property (nonatomic, strong) BaseTableView * mainView;

@end

@implementation B_AboutUsVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setTitle:@"关于我们"];
    self.view = self.mainView;
    
}

- (BaseTableView *)mainView {
    if (!_mainView) {
//        WeakSelf(weSelf, self);
        _mainView = [[BaseTableView alloc] init];
        
        [_mainView setTableViewFrameWithTop:5 left:0 right:0 bottom:0];
        [_mainView.tableView registerNib:[UINib nibWithNibName:@"B_AboutUsTVC" bundle:nil] forCellReuseIdentifier:@"B_AboutUsTVC"];
        _mainView.numberOfRowsBlock = ^NSInteger(UITableView *tableView, NSInteger section) {
            return 2;
        };
        _mainView.heightForRowBlock = ^CGFloat(UITableView *tableView, NSIndexPath *indexPath) {
            return 80;
        };
        _mainView.heightForHeaderBlock = ^CGFloat(UITableView *tableView, NSInteger section) {
            return 150;
        };
        _mainView.viewForHeaderBlock = ^UIView *(UITableView *tableView, NSInteger section) {
            B_AboutUsHeaderView * header = [B_AboutUsHeaderView initB_AboutUsHeaderView];
            
            return header;
        };
        _mainView.cellForRowBlock = ^UITableViewCell *(UITableView *tableView, NSIndexPath *indexPath) {
            B_AboutUsTVC * cell = [tableView dequeueReusableCellWithIdentifier:@"B_AboutUsTVC" forIndexPath:indexPath];
            cell.B_titleLabel.text = @"向往官网";
            cell.B_contentLabel.text = @"www.xiangwang.com";
            return cell;
        };
        _mainView.didSelectRow = ^(UITableView *tableView, NSIndexPath *indexPath) {
            
        };
        
    }
    return _mainView;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
